package search;

public class FibonacciSeq {
    public static int maxSize = 20;
    public static void main(String[] args) {
        int num = fibonacci(7);
        System.out.println(num);
    }

    /**
     * 递归方法获得第n个斐波那契数
     */
    public static int fibonacci(int n){
        if (n ==1 || n==2){
            return 1;
        }
        return fibonacci(n-1)+fibonacci(n-2);
    }

}
